package com.husd.framework.util;

import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlText;
import lombok.Data;

import java.util.List;

/**
 * @author shengdonghu@126.com
 * @date 2023/4/24 14:08
 */
@Data
@JacksonXmlRootElement(localName = "AddItemRequest")
public class XmlTestObj {

    @JacksonXmlElementWrapper(useWrapping = false)
    @JacksonXmlProperty(localName = "SubItem")
    private List<OpenSdkEbayAddItemItem> subItem;

    @JacksonXmlProperty(localName = "SubItem2")
    private OpenSdkEbayAddItemItem subItem2;

    @JacksonXmlProperty(localName = "Item")
    private String item;

    @Data
    @JacksonXmlRootElement(localName = "SubItem")
    public class OpenSdkEbayAddItemItem {

        @JacksonXmlProperty(localName = "abcd", isAttribute = true)
        private Boolean subItem;

        @JacksonXmlProperty(localName = "abcd2", isAttribute = true)
        private Boolean subItem2;

        @JacksonXmlText
        private String item;
    }

    @Data
    @JacksonXmlRootElement(localName = "SubItem2")
    public class OpenSdkEbayAddItemItem2 {

        @JacksonXmlProperty(localName = "abcd", isAttribute = true)
        private Boolean subItem;

        @JacksonXmlProperty(localName = "abcd2", isAttribute = true)
        private Boolean subItem2;

        @JacksonXmlText
        private String item;
    }


}
